#!/usr/bin/env python3

def main():
    num = int(open("A").read())
    data = open("B").read()

    w = []

    for c in data:
        if 'a' <= c <= 'z' or 'A' <= c <= 'Z':
            w.append(c)
        elif w:
            num -= 1
            if num == 0:
                break
            w = []

    print(''.join(w))


if __name__ == "__main__":
    main()
